package com.example.dp.jiemian.bt4;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.example.dp.jiemian.R;
import com.example.dp.jiemian.bt4.bean.AnimationButton;
import com.example.dp.jiemian.bt4.bean.SwicjButton;

public class bt4 extends AppCompatActivity {

    private AnimationButton abt;
    private TextView tv1,tv2;
    private SwicjButton sbt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bt4);

        abt = findViewById(R.id.bt4_abt);
        tv1 = findViewById(R.id.bt4_tv1);
        tv2 = findViewById(R.id.bt4_tv2);
        sbt = findViewById(R.id.bt4_sbt);
        abt.setAnimationButtonListener(new AnimationButton.AnimationButtonListener() {
            @Override
            public void onClickListener() {
                tv2.setVisibility(View.GONE);
                abt.start();
            }

            @Override
            public void animationFinish() {
                tv1.setVisibility(View.VISIBLE);
            }
        });

        sbt.setOnMbClickListener(isRight -> {
            if (isRight){
                Toast.makeText(bt4.this, "1", Toast.LENGTH_SHORT).show();
            }else {
                Toast.makeText(bt4.this, "0", Toast.LENGTH_SHORT).show();
            }
        });
    }

}
